//
//  extension.swift
//  微博
//
//  Created by 吕东星 on 17/3/27.
//  Copyright © 2017年 lddongxing. All rights reserved.
//

import UIKit

// 给UIView拓展属性
 extension UIView {
//获取, 设值x坐标和y坐标

    var x :CGFloat {
     get {
        return frame.origin.x

   } set{
    
    frame.origin.x = newValue
   }
}
    var y :CGFloat{
        get{
        return frame.origin.y
        
        }set{
        
        frame.origin.y = newValue
        }
}
    
   //获取, 设值 宽度和高度
    
    var width : CGFloat{
        get{
        return frame.size.width
        }set{
         frame.size.width = newValue
        }
    }
    
    var height :CGFloat{
        get{
        return frame.size.height
        }set{
         frame.size.height = newValue
        }
    
    
    }
    
    //获取, 设值x中心和y中心
    
    
    var centerX :CGFloat{
    
        get{
        return center.x
        }set{
        center.x = newValue
        }
}
    var centerY :CGFloat{
        get{
        return center.y
        }set{
        center.y = newValue
        }
    
    }
    
    var size :CGSize{
        get{
         return frame.size
        }set{
        
        frame.size = newValue
        }
}
    
    
    
    
    
    
    
    
    
    
    
    
    
    
}
